Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed email address validation regex #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HazemSayad
Copy link
Contributor

The original latest code is escaping a back slash instead of escaping the dot, but the expression fails subdomains check such as @gmail.com.edu so there is a community pattern that is already a good fit and works flawlessly so far so it is added into the commit

Please check if the PR fulfills these requirements:

  • The PR title and message describe the solution briefly.
  • Documentation has been updated/added if relevant

What is the current behavior?

fixes #21
Also fixes email validation regex snippet where there was a typo maybe and instead of escaping the dot . the character being escaped was a backslash \.

What is the new behavior?

Matches emails correctly and works with subdomains as well such as @gmail.com.edu

Other information?

This is a significant change and improves on the email validation regex snippet

Tested manually on https://regexr.com/
Credits to the expression goes to: https://regexr.com/2rhq7

The original code is escaping a back slash instead of escaping the dot, but the expression fails subdomains check such as @gmail.com.edu so there is a community pattern is already a good fit and works flawlessly so far so it is added into the commit
@monizb
Copy link
Owner

monizb commented Jun 9, 2022

Hey @HazemSayad thank you once again for helping the repository out, I just had one question, it doesn't seem to match uppercase emails now, was that the case even with the initial regex?

@HazemSayad
Copy link
Contributor Author

hello @monizb

it doesn't seem to match uppercase emails now

the expression should work on both uppercase and lowercase letters since i am ending the expression with the i flag for ignore case in /...$/igm. If you are using the link for credits, please enable the ignore case flag from the flags drop down menu.

thank you once again for helping the repository out

You are most welcome, i find it a very helpful extension and i found an opportunity to help so here i am.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Email validation snippit matches improper emails as well
2 participants